package com.zdp.common.exception;

import com.zdp.common.constant.ApiConstant;

/**
 * @author sesshomaru
 * @date 2021/7/30
 * 全局异常
 */
public class GlobalException extends RuntimeException {

    private Integer errorCode;

    public GlobalException() {
        super(ApiConstant.ERROR_MESSAGE);
        this.errorCode = ApiConstant.ERROR_CODE;
    }

    public GlobalException(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public GlobalException(String message) {
        super(message);
        this.errorCode = ApiConstant.ERROR_CODE;
    }

    public GlobalException(Integer errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }
}
